﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WStest.Models
{

public class PostitView {

    public PostitView()
    {
    }
    public PostitView(string username, string content, string date) {
        this.username = username;
        this.content = content;
        this.date = date;
    }

    public string content { get; set; }
    public string date { get; set; }
    public string username { get; set; }

    private DateTime getInternalDate() {
        return DateTime.Parse(date);
    }
    
    public int compareTo(PostitView t) {
        long d1 = this.getInternalDate().Millisecond;
        long d2 = t.getInternalDate().Millisecond;
        if (d1 > d2) {
            return -1;
        } else if (d1 < d2) {
            return 1;
        } else {
            return 0;
        }
    }
    
}

}